//用户详细信息
const userDetail = require('../mongo/userDetail')
var connect = {
	find: function (data, callback) {
		userDetail.find(data,{_id:0}, function (err, datas) {
			callback(datas)
		})
	},
	add: function (data, callback) {
		new userDetail(data).save(function (err, datas) {
			if (!err) callback(1)
			else{
				console.log(err)
			}
		})
	},
	// 修改
	update: function (factor, data, callback) {
		userDetail.updateOne(factor, data, function (err, res) {
			if (!err) return callback(1)
			else{
				callback(0)
			}
		})
	},
	// 删除
	delete: function(data,callback){
		userDetail.remove(data,function(err,data){
			if(!err){
				return callback(1)
			}else{
				return callback(0)
			}
		})
	}
}
module.exports = connect
